<extend name="Public/baseConf" />
<block name="breadcrumb"> 
	<div class="row wrapper border-bottom white-bg page-heading">
	    <div class="col-lg-8">
	        <h2><if condition="ACTION_NAME eq 'addaction'">新增<else/>编辑</if>行为</h2>
	        <ol class="breadcrumb">
	            <li><a href="{:U('index/index')}">首页</a></li>
	            <li><a href="{:U('action')}">行为列表</a></li>
	            <li class="active">
	                <strong><if condition="ACTION_NAME eq 'addaction'">新增<else/>编辑</if>行为</strong>
	            </li>
	        </ol>
	    </div>	    
	    <div class="col-lg-4">
            <div class="title-action">
 				<button class="btn btn-primary ajax-post" type="submit" target-form="form-horizontal"><i class="fa fa-check"></i>保存</button>
	            <a class="btn btn-warning" type="submit" href="{:U('action')}"><i class="fa fa-reply"></i>返回</a>
            </div>
        </div>
	</div> 
</block>
<block name="body">
	<div class="row">
	    <div class="col-lg-12">
	        <div class="ibox float-e-margins">
	            <div class="ibox-title">
	                <h5>请在下表中填入信息<small></small></h5>
	                <div class="ibox-tools">
	                    <a class="collapse-link">
	                        <i class="fa fa-chevron-up"></i>
	                    </a>
	                </div>
	            </div>
	            <div class="ibox-content">
	                <form id="form" action="{:U('saveAction')}" method="post" class="form-horizontal">
	                    <div class="form-group"><label class="col-sm-3 control-label">行为标识<span class="check-tips">（输入行为标识 英文字母）</span></label>
	                        <div class="col-sm-9"><input id="username" name="name" value="{$data.name}" class="form-control" required="" type="text" ></div>
	                    </div>
	                    <div class="hr-line-dashed"></div>
	                    <div class="form-group"><label class="col-sm-3 control-label">行为名称<span class="check-tips">（输入行为名称）</span></label>
	                        <div class="col-sm-9"><input id="username" name="title" value="{$data.title}" class="form-control" required="" type="text" ></div>
	                    </div>
	                    <div class="hr-line-dashed"></div>
	                    <div class="form-group"><label class="col-sm-3 control-label">行为类型<span class="check-tips">（选择行为类型）</span></label>
	                        <div class="col-sm-9">
					            <select name="type" class="form-control" >
									<volist name=":get_action_type(null,true)" id="vo">
										<option value="{$key}">{$vo}</option>
									</volist>
								</select>
	                        </div>
	                    </div>
	                    <div class="hr-line-dashed"></div>
	                    <div class="form-group"><label class="col-sm-3 control-label">行为描述<span class="check-tips">（输入行为描述）</span></label>
	                        <div class="col-sm-9">
	                        <textarea class='form-control' name="remark">{$data.remark}</textarea> 
	                        </div>
	                    </div>
	                    <div class="hr-line-dashed"></div>
	                    <div class="form-group"><label class="col-sm-3 control-label">行为规则<span class="check-tips">（输入行为规则，不写则只记录日志）</span></label>
	                        <div class="col-sm-9">
	                        <textarea class='form-control' name="rule">{$data.rule}</textarea> 
	                        </div>
	                    </div>
	                    <div class="hr-line-dashed"></div>
	                    <div class="form-group"><label class="col-sm-3 control-label">日志规则<span class="check-tips">（记录日志备注时按此规则来生成，支持[变量|函数]。目前变量有：user,time,model,record,data）</span></label>
	                        <div class="col-sm-9">
	                        <textarea class='form-control' name="log">{$data.log}</textarea> 
	                        </div>
	                    </div>
						<input type="hidden" name="id" value="{$data.id}"/>
	                </form>
	            </div>
	        </div>
	    </div>
	</div> 
</block>

<block name="script">
<script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
<script type="text/javascript" charset="utf-8">
	Think.setValue('type',{$type|default=1});
</script>
</block>
